﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;

namespace MengCC.Core.IO
{
    public class DefaultIOEnventHandler : IIOEnventHandler
    {
        private Action<string> Handler;

        public DefaultIOEnventHandler(Action<string> handler, string iOKey, IIOEnventHandler.EventTypeEnum eventType)
        {
            Handler = handler;
            IOKey = iOKey;
            EventType = eventType;
        }

        public string IOKey { get; set; }
        public IIOEnventHandler.EventTypeEnum EventType { get; set; }
        public string Id { get; set; }

        public async Task OnPush(string content)
        {
            await Task.Delay(10);
            Handler?.Invoke(content);
        }
    }
}
